OPC-UA Embedded Server SDK  2.1.0
ua_server.h
Go to the documentation of this file.
1 
3 /*****************************************************************************/
9 /*****************************************************************************/
10 /* Copyright (c) 2009 - 2013 MatrikonOPC.
11  *
12  * ALL RIGHTS RESERVED.
13  *
14  * The information contained herein is the confidential and proprietary product
15  * of MatrikonOPC. Any unauthorized use, reproduction or
16  * transfer of this information is strictly prohibited.
17  */
18 
19 #ifndef _UA_SERVER_
20 #define _UA_SERVER_
21 
22 /*****************************************************************************/
23 /* Include Files
24  */
25 #include "ua_types.h"
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 /*****************************************************************************/
32 /* Defines Macros Types
33  */
34 
35 /*****************************************************************************/
36 /* Data
37  */
38 
39 /*****************************************************************************/
40 /* Functions
41  */
42 
46 /*****************************************************************************/
56 uint32_t UAServer_Callback_millisecond(void);
57 
58 /*****************************************************************************/
70 int64_t UAServer_Callback_datetime(void);
71 
72 /*****************************************************************************/
83 
84 /*****************************************************************************/
110 void* UAServer_Callback_memcpy(void * destination, const void * source, size_t num);
111 
112 /*****************************************************************************/
135 void* UAServer_Callback_memchr(const void* ptr, int32_t value, size_t num);
136 
137 /*****************************************************************************/
159 void* UAServer_Callback_memset(void * ptr, int32_t value, size_t num);
160 
161 /*****************************************************************************/
187 int UAServer_Callback_memcmp(const void * ptr1, const void * ptr2, size_t num);
188 
189 /*****************************************************************************/
211 char* UAServer_Callback_strncpy(char *destination, const char *source, size_t num);
212 
213 /*****************************************************************************/
231 void* UAServer_Callback_malloc(size_t size);
232 
233 /*****************************************************************************/
248 void UAServer_Callback_free(void *ptr);
249 
255 /*****************************************************************************/
285 void UAServer_Callback_read(uint32_t node_handle,
286  UA_Value_type_t value_type,
287  uint32_t max_array_length,
288  uintptr_t read_context);
289 
290 /*****************************************************************************/
326 UA_Status_t UAServer_Perform_read(uintptr_t read_context,
327  UA_Value_t data_value,
328  int64_t source_timestamp,
329  UA_Status_t status_code);
330 
331 /*****************************************************************************/
363 void UAServer_Callback_write(uint32_t node_handle,
364  UA_Value_type_t value_type,
365  UA_Status_t status_code,
366  uint32_t max_array_length,
367  uintptr_t write_context);
368 
369 /*****************************************************************************/
411 UA_Status_t UAServer_Perform_write(uintptr_t write_context,
412  UA_Value_t data_value,
413  int64_t* source_timestamp,
414  bool_t completes_asynchronously,
415  uint32_t* new_length_of_array);
416 
417 /*****************************************************************************/
446 void UAServer_Set_write_operation_level_result_code( uintptr_t write_context,
447  UA_Status_t result_code);
448 
449 /*****************************************************************************/
474 void UAServer_Callback_monitored_item(uint32_t node_handle, uint32_t monitored_item_id,
475  UA_Mon_Item_Callback_Operation_t operation, uint64_t sampling_interval_ms);
476 
482 /*****************************************************************************/
513  const UA_UTF8_string_t* password,
514  uint16_t* user_index);
515 
516 /*****************************************************************************/
557  const UA_UTF8_string_t* thumbprint,
558  uint16_t* user_index);
559 
565 /*****************************************************************************/
576 int64_t UAServer_Get_datetime(void);
577 
578 /*****************************************************************************/
591 
592 /*****************************************************************************/
620  int64_t timestamp,
621  const char* file_name,
622  uint32_t line_number,
623  UA_Log_payload_t payload_type,
624  const void* payload,
625  uint32_t payload_length);
626 
627 /*****************************************************************************/
642 void UAServer_Printf( int64_t timestamp, const char* format, ... );
643 
644 /*****************************************************************************/
673  uint32_t* total_memory_provided,
674  uint32_t* memory_unusable,
675  uint32_t* max_memory_used_this_run,
676  uint32_t* total_memory_recommended);
677 
683 /*****************************************************************************/
724 
725 /*****************************************************************************/
731 void UAServer_Terminate(void);
732 
733 /*****************************************************************************/
748 UA_Status_t UAServer_Add_IP_address(uint8_t* ip_address);
749 
750 /*****************************************************************************/
763 
764 /*****************************************************************************/
777 UA_Status_t UAServer_Add_hostname(const char* hostname);
778 
779 /*****************************************************************************/
789 
790 /*****************************************************************************/
799 void UAServer_Poll(void);
800 
801 /*****************************************************************************/
819 UA_Status_t UAServer_Set_URI(const char* uri);
820 
821 /*****************************************************************************/
832 UA_Status_t UAServer_Start(const char* license);
833 
834 /*****************************************************************************/
848 
849 /*****************************************************************************/
861 UA_Server_state_t UAServer_Get_state(bool_t* shutdown_complete);
862 
868 /*****************************************************************************/
885 
886 /*****************************************************************************/
904 UA_Status_t UAServer_Get_certificate_size(uint32_t* size_in_bytes);
905 
906 /*****************************************************************************/
924 
925 /*****************************************************************************/
944 
950 /*****************************************************************************/
964 void* UAServer_Malloc(size_t size);
965 
966 /*****************************************************************************/
977 void* UAServer_Calloc(size_t size);
978 
979 /*****************************************************************************/
993 void* UAServer_Realloc(void* ptr, size_t size);
994 
995 /*****************************************************************************/
1003 void UAServer_Free(void* ptr);
1004 
1010 /*****************************************************************************/
1022 bool_t UAServer_Is_read_operation_asynchronous(uintptr_t read_context);
1023 
1024 /*****************************************************************************/
1036 bool_t UAServer_Is_read_operation_deferrable(uintptr_t read_context);
1037 
1038 /*****************************************************************************/
1050 bool_t UAServer_Is_read_operation_deferred(uintptr_t read_context);
1051 
1052 /*****************************************************************************/
1068 UA_Status_t UAServer_Defer_read_operation(uintptr_t read_context, uintptr_t* deferral_handle);
1069 
1070 /*****************************************************************************/
1087 UA_Status_t UAServer_Read_deferral_complete(uintptr_t deferral_handle, UA_Status_t status_code);
1088 
1089 /*****************************************************************************/
1104 void UAServer_Callback_deferred_read_operation_aborted(uintptr_t deferral_handle);
1105 
1111 /*****************************************************************************/
1136 const UA_UTF8_string_t* UAServer_Callback_translate(uint16_t locale_index,
1137  uint32_t text_handle);
1138 
1139 /*****************************************************************************/
1175  uint16_t locale_index,
1176  uint32_t enum_handle,
1177  uint16_t enum_index);
1178 
1179 /*****************************************************************************/
1209  uint16_t locale_index, uint32_t text_index);
1210 
1216 #if (UA_INCLUDE_FILE_TRANSFER_METHODS > 0)
1217 /*****************************************************************************/
1232  uint32_t node_handle,
1233  uintptr_t context);
1234 
1235 /*****************************************************************************/
1257  uintptr_t context,
1258  uint64_t size,
1259  UA_Status_t result);
1260 
1261 /*****************************************************************************/
1308  uint32_t node_handle,
1309  uint8_t mode,
1310  uintptr_t context);
1311 
1312 /*****************************************************************************/
1344  uintptr_t context,
1345  uint32_t file_handle,
1346  UA_Status_t result);
1347 
1348 /*****************************************************************************/
1370  uint32_t node_handle,
1371  uint32_t file_handle,
1372  uintptr_t context);
1373 
1374 /*****************************************************************************/
1392  uintptr_t context,
1393  UA_Status_t result);
1394 
1395 /*****************************************************************************/
1425  uint32_t node_handle,
1426  uint32_t file_handle,
1427  int32_t length,
1428  uintptr_t context);
1429 
1430 /*****************************************************************************/
1455  uintptr_t context,
1456  UA_Byte_string_t data,
1457  UA_Status_t result);
1458 
1459 /*****************************************************************************/
1486  uint32_t node_handle,
1487  uint32_t file_handle,
1488  UA_Byte_string_t data,
1489  uintptr_t context);
1490 
1491 /*****************************************************************************/
1513  uintptr_t context,
1514  UA_Status_t result);
1515 
1516 /*****************************************************************************/
1537  uint32_t node_handle,
1538  uint32_t file_handle,
1539  uintptr_t context);
1540 
1541 /*****************************************************************************/
1563  uintptr_t context,
1564  uint64_t position,
1565  UA_Status_t result);
1566 
1567 /*****************************************************************************/
1593  uint32_t node_handle,
1594  uint32_t file_handle,
1595  uint64_t position,
1596  uintptr_t context);
1597 
1598 /*****************************************************************************/
1616  uintptr_t context,
1617  UA_Status_t result);
1618 #endif
1619 
1625 /*****************************************************************************/
1638 UA_Status_t UAServer_New_connection(uint64_t connection_id);
1639 
1640 /*****************************************************************************/
1653 UA_Status_t UAServer_Connection_closed(uint64_t connection_id);
1654 
1655 /*****************************************************************************/
1667 void UAServer_Callback_close_connection(uint64_t connection_id);
1668 
1669 /*****************************************************************************/
1688 UA_Status_t UAServer_New_data_received(void* read_context, uint64_t connection_id);
1689 
1690 /*****************************************************************************/
1717 bool_t UAServer_Callback_data_receive(void* application_context,
1718  uint64_t connection_id,
1719  uint8_t* buffer,
1720  uint32_t max_length_in_bytes,
1721  uint32_t* no_of_bytes_received);
1722 
1723 /*****************************************************************************/
1742 UA_Status_t UAServer_Get_data_to_send(void* write_context, uint64_t connection_id);
1743 
1744 /*****************************************************************************/
1773 bool_t UAServer_Callback_data_send(void* application_context,
1774  uint64_t connection_id,
1775  uint8_t* buffer,
1776  uint32_t no_of_bytes_to_send,
1777  uint32_t* no_of_bytes_sent);
1778 
1779 /*****************************************************************************/
1792 UA_Status_t UAServer_Ready_to_receive(uint64_t connection_id, bool_t* result);
1793 
1799 /*****************************************************************************/
1808 
1809 /*****************************************************************************/
1820 UA_Status_t UAServer_Delete_node(uint32_t node_handle);
1821 
1822 /*****************************************************************************/
1835 
1836 /*****************************************************************************/
1846 UA_Status_t UAServer_Create_Folder(const UA_Folder_t* configuration);
1847 
1848 /*****************************************************************************/
1860 void UAServer_Init_config_structure_View(UA_View_t* configuration);
1861 
1862 /*****************************************************************************/
1878 UA_Status_t UAServer_Create_View(const UA_View_t* configuration);
1879 
1880 /*****************************************************************************/
1893 
1894 /*****************************************************************************/
1906 UA_Status_t UAServer_Create_Method(const UA_Method_t* configuration);
1907 
1908 /*****************************************************************************/
1921 
1922 /*****************************************************************************/
1933 
1934 /*****************************************************************************/
1947 
1948 /*****************************************************************************/
1958 UA_Status_t UAServer_Create_DataItem(const UA_DataItem_t* configuration);
1959 
1960 /*****************************************************************************/
1973 
1974 /*****************************************************************************/
1985 
1986 /*****************************************************************************/
1999 
2000 /*****************************************************************************/
2011 
2012 /*****************************************************************************/
2025 
2026 /*****************************************************************************/
2037 
2038 /*****************************************************************************/
2050 void UAServer_Init_config_structure_File(UA_File_t* configuration);
2051 
2052 #if (UA_INCLUDE_FILE_TRANSFER_METHODS > 0)
2053 /*****************************************************************************/
2063 UA_Status_t UAServer_Create_File(const UA_File_t* configuration);
2064 #endif
2065 
2066 /*****************************************************************************/
2080 UA_Status_t UAServer_Add_to_folder(uint32_t folder_handle, uint32_t node_handle);
2081 
2082 /*****************************************************************************/
2102 UA_Status_t UAServer_Add_to_folder_with_view_mask(uint32_t folder_handle,
2103  uint32_t node_handle,
2104  uint16_t view_mask);
2105 
2106 /*****************************************************************************/
2119 UA_Status_t UAServer_Add_to_objects_folder(uint32_t node_handle);
2120 
2126 #if (UA_INCLUDE_ASYNC_OPS > 0)
2127 /*****************************************************************************/
2143 void UAServer_Callback_process_asynchronously(uintptr_t operation_handle);
2144 
2145 /*****************************************************************************/
2155 uintptr_t UAServer_Process_asynchronously(uintptr_t operation_handle);
2156 
2157 /*****************************************************************************/
2166 void UAServer_Operation_completed(uintptr_t operation_handle);
2167 
2168 /*****************************************************************************/
2182 
2183 /*****************************************************************************/
2197 
2198 /*****************************************************************************/
2212 
2213 /*****************************************************************************/
2227 
2228 #endif /*(UA_INCLUDE_ASYNC_OPS > 0)*/
2229 
2235 #if (UA_INCLUDE_SECURITY > 0)
2236 
2237 /*****************************************************************************/
2248 
2249 /*****************************************************************************/
2276  const UA_Configuration_t* sdk_configuration,
2277  const char* server_uri,
2278  const char** hostnames, int no_of_hostnames,
2279  const char** ip_addresses, int no_of_ip_addresses);
2280 
2281 /*****************************************************************************/
2292 
2293 /*****************************************************************************/
2308 
2309 /*****************************************************************************/
2319 
2320 /*****************************************************************************/
2354 void UASecurity_Set_validation_options(uint32_t option_bits);
2355 
2356 /*****************************************************************************/
2367 UA_Status_t UASecurity_Get_thumbprint(const char* filepath, char* thumbprint, uint32_t thumbprint_max_length);
2368 
2369 /*****************************************************************************/
2381 
2382 /*****************************************************************************/
2394 
2395 #endif /*(UA_INCLUDE_SECURITY > 0)*/
2396 
2399 #ifdef __cplusplus
2400 }
2401 #endif
2402 
2403 #endif /*_UA_SERVER_*/